<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">

<head>
    <title>Cargo Administration</title>
    <link rel="stylesheet" type="text/css" th:href="@{/admin.css}"/>
</head>

<body>
<div id="outer">
    <div th:replace="adminDecorator :: adminbody"/>
    <div id="body">
        <table border="1" width="600">
            <caption>All cargos</caption>
            <thead>
            <tr>
                <td>Tracking ID</td>
                <td>Origin</td>
                <td>Destination</td>
                <td>Routed</td>
            </tr>
            </thead>
            <tbody>
            <tr th:each="cargo : ${cargoList}">
                <td>
                    <a th:href="@{/admin/show(trackingId=${cargo.trackingId})}"
                       th:text="${cargo.trackingId}">Tracking id</a>
                </td>
                <td th:text="${cargo.origin}">Origin</td>
                <td th:text="${cargo.finalDestination}">Final destination</td>
                <td th:text="(${cargo.misrouted} ? 'Misrouted' : '') + (${cargo.routed} ? 'Yes' : 'No')"></td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
</body>
</html>